package com.zmx.patients.adapter;

import android.app.Activity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import androidx.annotation.NonNull;

import com.wang.adapters.adapter.BaseAdapterRvList;
import com.wang.adapters.base.BaseViewHolder;
import com.zmx.patients.R;
import com.zmx.patients.pojo.BloodPressure;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * 程序猿：胖胖祥
 * 时 间：2020/10/19  1:44
 * 功 能：
 */
public class BloodPressureListAdapter  extends BaseAdapterRvList<BloodPressureListAdapter.ViewHolder, BloodPressure> {

    public BloodPressureListAdapter(Activity activity) {
        super(activity);
    }

    @Override
    protected void onBindVH(ViewHolder holder, int listPosition, BloodPressure bloodPressure) {

        holder.time.setText(bloodPressure.getBptime());
        holder.value_a.setText(bloodPressure.getDiastolic()+"");
        holder.value_b.setText(bloodPressure.getSystolic()+"");

    }

    @NonNull
    @Override
    protected ViewHolder onCreateVH(ViewGroup parent, LayoutInflater inflater) {

        BloodPressureListAdapter.ViewHolder holder = new BloodPressureListAdapter.ViewHolder(inflater.inflate(R.layout.adapter_blood_pressure, parent, false));
        return holder;
    }

    static class ViewHolder extends BaseViewHolder {

        @BindView(R.id.time)
        TextView time;
        @BindView(R.id.text_sy)
        TextView value_a;
        @BindView(R.id.text_ss)
        TextView value_b;

        ViewHolder(View view) {
            super(view);
            ButterKnife.bind(this, view);
        }

    }

}
